package jpa.entitys.synchro.staging;

import java.io.Serializable;

import javax.persistence.*;

import java.util.Date;


/**
 * The persistent class for the MESSAGES database table.
 * 
 */
@Entity
@Table(name="MESSAGES")
@NamedQueries({
    @NamedQuery(name = "Message.findAll", query = " SELECT c FROM Message c "),
    @NamedQuery(name = "Message.findById", query = " SELECT c FROM Message c WHERE c.messagesId = :Id "),
    @NamedQuery(name = "Message.findByCompany", query = " SELECT c FROM Message c WHERE c.company = :company "),
    @NamedQuery(name = "Message.findByCode", query = " SELECT c FROM Message c WHERE c.code = :code And c.messagesGroup = :messagesGroup "),
    @NamedQuery(name = "Message.findByInstanceNo", query = " SELECT c FROM Message c WHERE c.code = :code And c.instanceNo = :instanceNo ")
    })
public class Message extends jpa.entitys.synchro.common.CommonEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="MESSAGES_ID", unique=true, nullable=false, updatable=true, insertable=true, length=100)
	@GeneratedValue
	private String messagesId;
	
	@Override public String toString() { return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this);}

	@Column(name="ACTION", length=250)
	private String action;

	@Column(name="ALTERNATE_DESCRIPTION", length=500)
	private String alternateDescription;

	@Column(name="CODE", nullable=false, length=100)
	private String code;

	@Column(name="COMPANY",length=2)
	private String company;

	@Column(name="CREATED_BY", length=30)
	private String createdBy;

	@Column(name="CREATED_ON", length=20)
	private String createdOn;

	@Column(name="DESCRIPTION", length=500)
	private String description;

	@Column(name="EXT_REF_KEY", length=100)
	private String extRefKey;

	@Column(name="EXT_REF_NO", length=100)
	private String extRefNo;

	@Column(name="INSTANCE_NO", length=100)
	private String instanceNo;

	@Column(name="ISACTIVE", length=1)
	private String isactive;

	@Column(name="ISSYNC",length=1)
	private String issync;

	@Column(name="MSG_ACT_RESULT", length=100)
	private String msgActResult;

	@Column(name="MSG_ALT_DESC", length=300)
	private String msgAltDesc;

	@Column(name="MSG_CODE", length=100)
	private String msgCode;

	@Column(name="MSG_DESC", length=300)
	private String msgDesc;

	@Column(name="RESULT", length=250)
	private String result;

	@Column(name="SYNC_CREATEDBY", length=100)
	private String syncCreatedby;

    @Temporal(TemporalType.TIMESTAMP)
	@Column(name="SYNC_CREATEDON")
	private Date syncCreatedon;

	@Column(name="SYNC_UPDATEDBY", length=100)
	private String syncUpdatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_UPDATEDON")
	private Date syncUpdatedon;

	@Column(name="UPDATED_BY", length=30)
	private String updatedBy;

	@Column(name="ACTION_HANDLER", length=20)
	private String actionHandle;
	
	
	/**
	 * @return the actionHandle
	 */
	public String getActionHandle() {
		return actionHandle;
	}

	/**
	 * @param actionHandle the actionHandle to set
	 */
	public void setActionHandle(String actionHandle) {
		this.actionHandle = actionHandle;
	}

	@Column(name="UPDATED_ON", length=20)
	private String updatedOn;
	
	//bi-directional many-to-one association to MessagesGroup
    @ManyToOne
	@JoinColumn(name="MESSAGES_GROUP_ID", updatable=true, insertable=true, nullable=false)
	private MessagesGroup messagesGroup;

    public Message() {
    }

	public String getMessagesId() {
		return this.messagesId;
	}

	public void setMessagesId(String messagesId) {
		this.messagesId = messagesId;
	}

	public String getAction() {
		return this.action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public String getAlternateDescription() {
		return this.alternateDescription;
	}

	public void setAlternateDescription(String alternateDescription) {
		this.alternateDescription = alternateDescription;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getCompany() {
		return this.company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(String createdOn) {
		this.createdOn = createdOn;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getExtRefKey() {
		return this.extRefKey;
	}

	public void setExtRefKey(String extRefKey) {
		this.extRefKey = extRefKey;
	}

	public String getExtRefNo() {
		return this.extRefNo;
	}

	public void setExtRefNo(String extRefNo) {
		this.extRefNo = extRefNo;
	}

	public String getInstanceNo() {
		return this.instanceNo;
	}

	public void setInstanceNo(String instanceNo) {
		this.instanceNo = instanceNo;
	}

	public String getIsactive() {
		return this.isactive;
	}

	public void setIsactive(String isactive) {
		this.isactive = isactive;
	}

	public String getIssync() {
		return this.issync;
	}

	public void setIssync(String issync) {
		this.issync = issync;
	}

	public String getMsgActResult() {
		return this.msgActResult;
	}

	public void setMsgActResult(String msgActResult) {
		this.msgActResult = msgActResult;
	}

	public String getMsgAltDesc() {
		return this.msgAltDesc;
	}

	public void setMsgAltDesc(String msgAltDesc) {
		this.msgAltDesc = msgAltDesc;
	}

	public String getMsgCode() {
		return this.msgCode;
	}

	public void setMsgCode(String msgCode) {
		this.msgCode = msgCode;
	}

	public String getMsgDesc() {
		return this.msgDesc;
	}

	public void setMsgDesc(String msgDesc) {
		this.msgDesc = msgDesc;
	}

	public String getResult() {
		return this.result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getSyncCreatedby() {
		return this.syncCreatedby;
	}

	public void setSyncCreatedby(String syncCreatedby) {
		this.syncCreatedby = syncCreatedby;
	}

	public Date getSyncCreatedon() {
		return this.syncCreatedon;
	}

	public void setSyncCreatedon(Date syncCreatedon) {
		this.syncCreatedon = syncCreatedon;
	}

	public String getSyncUpdatedby() {
		return this.syncUpdatedby;
	}

	public void setSyncUpdatedby(String syncUpdatedby) {
		this.syncUpdatedby = syncUpdatedby;
	}

	public Date getSyncUpdatedon() {
		return this.syncUpdatedon;
	}

	public void setSyncUpdatedon(Date syncUpdatedon) {
		this.syncUpdatedon = syncUpdatedon;
	}

	public String getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public String getUpdatedOn() {
		return this.updatedOn;
	}

	public void setUpdatedOn(String updatedOn) {
		this.updatedOn = updatedOn;
	}

	public MessagesGroup getMessagesGroup() {
		return this.messagesGroup;
	}

	public void setMessagesGroup(MessagesGroup messagesGroup) {
		this.messagesGroup = messagesGroup;
	}
	
}